package cn.gson.crm.controller.job;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.EmploDao;
import cn.gson.crm.model.dao.StudentDao;
import cn.gson.crm.model.dao.StudentPoDao;
import cn.gson.crm.model.entity.Student;

@WebServlet("/student/graduated")
public class ShowStudentDetailServlet extends BaseServlet{

	/**
	 * 获取已毕业学员的详细信息
	 */
	private static final long serialVersionUID = 1L;
	StudentDao stuDao = new StudentDao();
	StudentPoDao stuPoDao = new StudentPoDao();
	
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String id= request.getParameter("id");
		Student stuDetail = stuDao.getStudentById("正常", "已分配", Integer.parseInt(id));
		String counselorName = new EmploDao().emploGetById("正常", stuDetail.getCounselorId()).getUserName();
		request.setAttribute("stuDetail", stuDetail);
		request.setAttribute("counselorName", counselorName);
		getServletPathAndForward(request, "student/stu_detail.jsp");
	}

}
